home *** CD-ROM | disk | FTP | other *** search
- head 1.2;
- branch ;
- access ;
- symbols sprited:1.2.1;
- locks ; strict;
- comment @ * @;
-
-
- 1.2
- date 90.10.11.22.10.13; author kupfer; state Exp;
- branches 1.2.1.1;
- next 1.1;
-
- 1.1
- date 88.06.10.16.23.34; author ouster; state Exp;
- branches ;
- next ;
-
- 1.2.1.1
- date 91.12.02.19.54.43; author kupfer; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.2
- log
- @Use function prototypes.
- @
- text
- @/*
- * Stdio_Setup.c --
- *
- * Source code for the "Stdio_Setup" library procedure.
- *
- * Copyright 1988 Regents of the University of California
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies. The University of California
- * makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without
- * express or implied warranty.
- */
-
- #ifndef lint
- static char rcsid[] = "$Header: /sprite/src/lib/c/stdio/RCS/Stdio_Setup.c,v 1.1 88/06/10 16:23:34 ouster Exp Locker: kupfer $ SPRITE (Berkeley)";
- #endif not lint
-
- #include "stdio.h"
-
- /*
- *----------------------------------------------------------------------
- *
- * Stdio_Setup --
- *
- * This procedure is called by a client to initialize the information
- * associated with a stream. This procedure is used by special-purpose
- * clients that provide their own low-level I/O; for normal file I/O,
- * use fopen, freopen, or fdopen.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The contents of stream are modified to set up for buffered I/O.
- * After this call has been made, the stream may be used in other
- * calls (e.g. getc and putc) to actually perform I/O.
- *
- *----------------------------------------------------------------------
- */
-
- void
- Stdio_Setup(stream, readable, writable, buffer, bufferSize, readProc,
- writeProc, closeProc, clientData)
- register FILE * stream; /* Stream to be initialized. */
- int readable; /* Non-zero means stream is to be readable. */
- int writable; /* Non-zero means stream is to be writable.
- * It's OK for a stream to be both readable
- * and writable.
- */
- unsigned char *buffer; /* Pointer to buffer space for the stream.
- * NULL means the stream will initially be
- * unbuffered. */
- int bufferSize; /* Size of buffer area. */
- void (*readProc) _ARGS_((FILE *stream));
- /* Procedure to perform input for stream. */
- void (*writeProc) _ARGS_((FILE *stream, Boolean flush));
- /* Procedure to perform output for stream. */
- int (*closeProc) _ARGS_((FILE *stream));
- /* Procedure to close stream. NULL means
- * there aren't any stream-dependent actions
- * to perform on close. */
- ClientData clientData; /* Client-specific information to store in
- * stream. */
- {
- stream->lastAccess = buffer-1;
- stream->readCount = 0;
- stream->writeCount = 0;
- stream->buffer = buffer;
- stream->bufSize = bufferSize;
- stream->readProc = readProc;
- stream->writeProc = writeProc;
- stream->closeProc = closeProc;
- stream->clientData = clientData;
- stream->status = 0;
- stream->flags = 0;
- if (readable) {
- stream->flags |= STDIO_READ;
- }
- if (writable) {
- stream->flags |= STDIO_WRITE;
- stream->writeCount = bufferSize;
- }
- }
- @
-
-
- 1.2.1.1
- log
- @Initial branch for Sprite server.
- @
- text
- @d17 1
- a17 1
- static char rcsid[] = "$Header: /sprite/src/lib/c/stdio/RCS/Stdio_Setup.c,v 1.2 90/10/11 22:10:13 kupfer Exp $ SPRITE (Berkeley)";
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d17 1
- a17 1
- static char rcsid[] = "$Header: atoi.c,v 1.1 88/04/28 17:20:23 ouster Exp $ SPRITE (Berkeley)";
- d56 6
- a61 3
- void (*readProc)(); /* Procedure to perform input for stream. */
- void (*writeProc)(); /* Procedure to perform output for stream. */
- int (*closeProc)(); /* Procedure to close stream. NULL means
- @
-